/**
 * 获取token
 * @returns
 */
export const getToken = () => sessionStorage.getItem("token");
/**
 * 设置token
 * @param {*} token
 * @returns
 */
export const setToken = (token) => sessionStorage.setItem("token", token);
/**
 * 移除token
 * @returns
 */
export const delToken = () => sessionStorage.removeItem("token");

/**
 * 图片加载
 * @param {*} url
 * @returns
 */
export const dalImg = (url) => {
  if (url) {
    if (url.startsWith("http")) return url;
    return "http://localhost:3006" + url;
  }
  return "https://img1.baidu.com/it/u=3979391043,266749828&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500";
};
